package com.itheima.esdemo;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.junit.After;
import org.junit.Before;

import java.io.IOException;

//文档的CRUD
public class EsDemo02 {

    private RestHighLevelClient restHighLevelClient;

    @Before
    public void init(){
        restHighLevelClient = new RestHighLevelClient(
                RestClient.builder(
                        //要连接的es地址
                        new HttpHost("192.168.200.150",9200,"http")));
    }

    @After
    public void close() throws IOException {
        restHighLevelClient.close();
    }
}
